package com.suning.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.suning.mapper.EbProductMapper;
import com.suning.model.EbProduct;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class ProductListService {
    @Resource
    private EbProductMapper ebProductMapper;
    public Map<String, Page> list(int page, int pageSize, int epcid){
        System.out.println("进入ProductListService的list方法=====");
        Map<String, Page> result = new HashMap<>();

        Page page1 = new Page(page,pageSize);
        Page listPage = ebProductMapper.selectPage(page1,new QueryWrapper<EbProduct>()
                .eq("epc_child_id",epcid));

        result.put("listPage",listPage);
        return result;
    }
}
